/* 
	公共过滤器
 */
export const formatTime = value => {
	const myDate = new Date(value * 1000);
	let yy = myDate.getFullYear();
	let mm = myDate.getMonth() + 1;
	let dd = myDate.getDate();
	//三元运算符：mm < 10 ? '0' + mm : mm 记得用()隔开，不然会出错；
	let HH = myDate.getHours();
	let MM = myDate.getMinutes();
	let SS = myDate.getSeconds();
	//三元运算
	HH = HH < 10 ? '0' + HH : HH;
	MM = MM < 10 ? '0' + MM : MM;
	SS = SS < 10 ? '0' + SS : SS;
	//拼接字符串
	return yy + "/" + (mm < 10 ? '0' + mm : mm) + '/' + (dd < 10 ? '0' + dd : dd) +' '+ HH + ':' + MM + ':' + SS;
}

export const formatTimeTwo = value => {
	const myDate = new Date(value * 1000);
	let yy = myDate.getFullYear();
	let mm = myDate.getMonth() + 1;
	let dd = myDate.getDate();
	//三元运算符：mm < 10 ? '0' + mm : mm 记得用()隔开，不然会出错；
	let HH = myDate.getHours();
	let MM = myDate.getMinutes();
	let SS = myDate.getSeconds();
	//三元运算
	HH = HH < 10 ? '0' + HH : HH;
	MM = MM < 10 ? '0' + MM : MM;
	SS = SS < 10 ? '0' + SS : SS;
	//拼接字符串
	return yy + "-" + (mm < 10 ? '0' + mm : mm) + '-' + (dd < 10 ? '0' + dd : dd) +' '+ HH + ':' + MM + ':' + SS;
}

export const formatTimeThree = value => {
	const myDate = new Date(value * 1000);
	let yy = myDate.getFullYear();
	let mm = myDate.getMonth() + 1;
	let dd = myDate.getDate();
	//三元运算符：mm < 10 ? '0' + mm : mm 记得用()隔开，不然会出错；
	let HH = myDate.getHours();
	let MM = myDate.getMinutes();
	let SS = myDate.getSeconds();
	//三元运算
	HH = HH < 10 ? '0' + HH : HH;
	MM = MM < 10 ? '0' + MM : MM;
	SS = SS < 10 ? '0' + SS : SS;
	//拼接字符串
	return HH + ':' + MM +' '+ (mm < 10 ? '0' + mm : mm) + '/' + (dd < 10 ? '0' + dd : dd);
}